property gettingall -- 0 if not started, 1 if started, 2 if finished
property gettingframes
property gettingmembers
property gettingmovie
-- will loop on the current frame while preloading is happening
on beginsprite me
set gettingall = 0
set gettingframes = 0
set gettingmembers = 0
set gettingmovie = 0
end
on init me
if tracking <> 2 then set tracking = TRUE
do_it
end
on do_it me
if tracking then
if (allmembers = TRUE and gettingall <> 2 ) and (framerange= TRUE and gettingframes <> 2 ) and (memberrange= TRUE and gettingmembers <> 2 ) and (amovie = TRUE and gettingmovie <> 2 ) then
if netaware then
if allmembers then
if not frameready() then go the frame
if gettingall = 0 then
set gettingall = 1
preload
set gettingall = 2
end if
end if
if framerange then
if not frameready (startframe, endframe) then go the frame
if gettingframes = 0 then
set gettingframes = 1
preload startframe, endframe
set gettingframes = 2
end if
end if
if memberrange then
if not mediaready (startMember, endMember) then go the frame
if gettingmembers = 0 then
set gettingmembers = 1
preloadMember startMember, endMember
set gettingmembers = 2
end if
end if
if amovie then
if gettingmovie = 0 then
set preloadID = preloadnetthing (moviename) -- ask Chris about this part
set gettingmovie = 1
end if
if not netDone(preloadID) then go the frame --netdoneID
set x = "Loads cast members into RAM so they are instantly available to the movie. Define what to preload by specifying a range of cast members in a cast or frames in the score. The behavior can also load all the cast members in a different movie. If the Internet Aware parameter is turned on, the behavior checks the network cache to make sure the media is on the local disk before it is loaded into RAM. "& RETURN & "PARAMETERS:" & RETURN & "ΓÇó Initializing Event - Specify the event that triggers the behavior." & RETURN & "ΓÇó All Members - Choose this option to load all cast members in the current movie starting at the current frame." & RETURN & "ΓÇó Frame Range - Turn this option on and define a range of frames to load. Enter the start and end frames of the range in the appropriate boxes."
set x = x & RETURN & "ΓÇó Member Range - Turn this option on and define a range of cast members within a cast. Choose the first and last cast members to load from the pop-ups." & RETURN & "ΓÇó Preload Movie - Turn this option on and enter the name of a Director movie in Movie Name. All the cast members in the movie are loaded. Use this parameter to reduce delays when switching to a different movie." & RETURN & "ΓÇó Internet Aware - Turn this option on to make Director check the network cache to make sure the media is on the local disk before preloading."